<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:51:"E:\WWW\waimai/app/wechat/shop\view\goods\index.html";i:1509358890;s:53:"E:\WWW\waimai/app/wechat/shop\view\template\base.html";i:1509423428;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">

    <title>外卖</title>
    <link rel="stylesheet" href="__STATIC__/css/mui.min.css">
    <link rel="stylesheet" href="__STATIC__/css/ks.css">
    
    <script>
        var require_path = "__STATIC__/app";
    </script>
    <script src="__STATIC__/app/require.js"></script>
    <script src="__STATIC__/app/require.config.js"></script>
    <script src="__STATIC__/app/plugin/jquery-3.2.1.min.js"></script>
    <script src="__STATIC__/app/plugin/mui/mui.min.js"></script>
    
</head>
<body>



<script src="__STATIC__/app/plugin/common_fun.js"></script>
<header class="header">
    <div>
        <a class="back" href="<?php echo url('shop/Shop/index'); ?>"><i class="iconfont icon-zuoyoujiantou-copy-copy-copy"></i></a>
        <?php echo $shop['name']; ?>
        <a id="#popover" style="line-height: 45px;" class="menu mui-action-menu mui-icon mui-icon-bars mui-pull-right"
           href="#popover"></a>

    </div>

</header>
<div id="popover" class="mui-popover" style="width: 100px;position: fixed;top: 58px!important;">
    <ul class="mui-table-view">
        <!--<li class="mui-table-view-cell"><a href="#">店铺详情</a></li>-->
        <li v-if="(is_collect==0)" class="mui-table-view-cell"><a @tap="collect(<?php echo $store_id; ?>)">收藏店铺</a></li>
        <li v-else class="mui-table-view-cell"><a @tap="del_collect(<?php echo $store_id; ?>)">取消收藏</a></li>
    </ul>
</div>
<div class="pages">
    <div id="buy_page">
        <div class="buy-page">
            <div class="shop-list head">
                <ul>
                    <li>
                        <div class="img"><img src="<?php echo $shop['logo']; ?>"/></div>
                        <div class="text">
                            <div class="title"><?php echo $shop['name']; ?></div>
                            <div>
                                <p class="ellipsis font12"><?php echo $shop['shop_address']; ?></p>
                                <p class="font12">
                                    <span>￥<?php echo $shop['aps_price']; ?>元</span>起送



                                </p>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
            <nav>
                <ul>
                    <li v-bind:class="[-1==c_index? 'active' : '']">
                        <a @tap.stop="get_list(0,-1)">全部</a>
                    </li>
                    <!--<li class="active">-->
                    <!--<a href="">热门</a>-->
                    <!--</li>-->

                    <template v-for="(c_vo, index) in c_list">
                        <li v-bind:class="[index==c_index? 'active' : '']">
                            <a @tap.stop="get_list(c_vo.id,index)">
                                <!--<template v-if="c_vo.isdefault ==1">-->
                                    <!--其他-->
                                <!--</template>-->

                                    {{c_vo.name}}

                            </a>
                        </li>
                    </template>


                    <!--<li>-->
                    <!--<a href="">东北菜</a>-->
                    <!--</li>-->
                    <!--<li>-->
                    <!--<a href="">热门</a>-->
                    <!--</li>-->
                    <!--<li>-->
                    <!--<a href="">小吃快餐</a>-->
                    <!--</li>-->
                    <!--<li>-->
                    <!--<a href="">川菜</a>-->
                    <!--</li>-->
                    <!--<li>-->
                    <!--<a href="">东北菜</a>-->
                    <!--</li>-->
                </ul>
            </nav>
            <div class="goods-list">
                <ul>
                     <template v-if="list.length>0">
                        <template v-for="vo in list">
                            <li @tap="detail(vo.id)">
                                <div class="img"><img :src="vo.cover_image"/></div>
                                <div class="text">
                                    <div class="title">{{vo.name}}</div>
                                    <div>
                                        <div class="l">
                                            <!--<p class="ellipsis font12">月售 90</p>-->
                                            <p class="font12">
                                                <span>￥{{vo.price}}元</span>
                                            </p>
                                        </div>

                                        <div class="r">
                                            <?php if(($shop['is_work']==1)): ?>
                                            <template v-if="vo.quantity>0">
                                                <span @tap.stop="down_tap(vo.price,vo.id,vo.v_flag)" class="down"
                                                      style="display: inline;"><i class="iconfont icon-wuuiconsuoxiao"></i></span>
                                                <input type="tel" readonly class="num" style="display: inline;"
                                                       :value="vo.quantity" maxlength="3">
                                            </template>
                                            <template v-else>
                                                <span @tap.stop="down_tap(vo.price,vo.id,vo.v_flag)" class="down"><i
                                                        class="iconfont icon-wuuiconsuoxiao"></i></span>
                                                <input type="tel" readonly class="num" :value="vo.quantity" maxlength="3">
                                            </template>
                                            <span @tap.stop="up_tap(vo.price,vo.id,vo.v_flag,vo.name)" class="up"> <i
                                                    class="iconfont icon-wuuiconxiangjifangda"></i></span>
                                            <?php else: ?>
                                            <span class="down" style="display: block;"> <i
                                                    class="iconfont icon-wuuiconxiangjifangda"></i></span>
                                            <?php endif; ?>
                                        </div>
                                    </div>
                                </div>
                            </li>
                        </template>
                     </template>
                    <template v-else>
                        <div class="tip-icon" >
                            <i class="iconfont icon-meishi"></i>
                            <p>暂无商品</p>
                        </div>
                    </template>
                </ul>
            </div>
            <?php if(($shop['is_work']==1)): ?>
            <div class="foot-btn">
                <!--<div>-->
                    <!--<a  class="btn">返回首页继续购物</a>-->
                <!--</div>-->
                <div style="padding:0;">
                    <!--<a href="<?php echo url('/cart/Cart/index'); ?>"> <i class="iconfont icon-gouwuche"></i></a>-->
                    <!--<span id="total_price"><?php echo $total_price; ?>元</span>-->
                    <!--<a @tap="send_btn()" id="send_btn" class="btn">去结算</a>-->



                    <!--<a href="<?php echo url('shop/Shop/index'); ?>" style="display:inline-block;-->
                    <!--height: 45px;width: 50%;margin-left: -15px; line-height: 45px; padding: 0 20px;-->
                    <!--background: #E76E70;color: #fff;text-align:center;box-sizing: border-box;-->
                    <!--font-size: 12px;">返回首页继续购买</a>-->
                    <!--<a href="<?php echo url('/cart/Cart/index'); ?>" style="display:inline-block;-->
                    <!--height: 45px;width: 50%;margin-right: -15px; line-height: 45px; padding: 0 20px;-->
                    <!--background: #FD2A4A;color: #fff;text-align:center;box-sizing: border-box;-->
                    <!--float: right;font-size: 12px;">去结算-->
                        <!--(<span id="total_price"><?php echo $total_price; ?>元</span>）</a>-->



                    <!--<span class="btn" style="width:50%;text-align: center;border-radius:100px;box-sizing: border-box">去结算-->
                        <!--(<span id="total_price"><?php echo $total_price; ?>元</span>)-->
                    <!--</span>-->


                    <a href="<?php echo url('shop/Shop/index'); ?>" style="display: inline-block;width: 50%;height: 45px;line-height:45px;background: #E76E70;text-align:center;color: #fff;float: left;">返回首页继续购买</a>
                    <a href="<?php echo url('/cart/Cart/index'); ?>" style="display: inline-block;width: 50%;height: 45px;line-height:45px;background: #FD2A4A;text-align:center;color: #fff;float: left;">去结算(<span id="total_price"><?php echo $total_price; ?>元</span>)</a>

                </div>
            </div>
            <?php else: ?>
            <div class="foot-btn color-gray">
                <div class="text-center" style="color: white;background-color: grey">
                    商家休息，停止接单
                </div>
            </div>
            <?php endif; ?>
        </div>
    </div>

    <div class="popups-module">
        <div class="popups-module-wrap" id="popups">
            <div class="popups-module-box">
                <!--<a class="btn">关闭</a>-->
                <div class="specification">
                    <div class="title">{{v_goods_name}}</div>
                    <p>规格</p>
                    <ul class="box">
                        <template v-for="(item, index) in v_items">
                            <li v-bind:class="[index==a_index? 'active' : '']" @tap="variant(item.id,item.price,index)">
                                {{item.name}}
                            </li>
                        </template>
                    </ul>
                </div>
            </div>
            <div class="popups-module-footer">
                <div class="specification">
                    <div class="price">
                        <span>￥{{v_price}}</span>
                        <a @tap="save_variant()" class="btn">确定</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



</body>
<script>
    if(document.querySelector('.goback')!=null){
        document.querySelector('.goback').addEventListener('tap', function () {
            history.back();
        })
    }

</script>

<script>
    var list_url = "<?php echo url('shop/Goods/get_list'); ?>";
    var clist_url = "<?php echo url('shop/Goods/get_clist'); ?>";
    var detail_url = "<?php echo url('shop/Goods/detail'); ?>";
    var send_order_url = "<?php echo url('order/Order/send_order'); ?>";
    var cart_url = "<?php echo url('cart/Cart/have_cart'); ?>";
    var add_cart_url = "<?php echo url('cart/Cart/add_cart'); ?>";
    var variant_url = "<?php echo url('shop/Goods/get_variant'); ?>";
    var collect_url = "<?php echo url('shop/Shop/collect_store'); ?>";
    var del_collect_url = "<?php echo url('shop/Shop/del_collect_store'); ?>";
    var store_id = "<?php echo $store_id; ?>";
    var total_price = "<?php echo $total_price; ?>";
    var is_collect = "<?php echo $is_collect; ?>";
    var distance = "<?php echo $distance; ?>";
    total_price = parseFloat(total_price);
    require(['goods/index']);
</script>

</html>